﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Watson.TemporaryFilesDeleter
{
    /// <summary>
    /// Event arguments for the <see cref="FileDelete.ErrorEncountered"/> event.
    /// </summary>
    public class ErrorEncounteredEventArgs : EventArgs
    {
        #region Private Read-only Fields

        /// <summary>
        /// An exception describing the error which was encountered.
        /// </summary>
        private readonly Exception error;

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets an exception describing the error which was encountered.
        /// </summary>
        public Exception Error
        {
            get { return this.error; }
        }

        #endregion

        #region Public Constructors

        /// <summary>
        /// Initialises a new instance of the ErrorEncounteredEventArgs class.
        /// </summary>
        public ErrorEncounteredEventArgs()
        { }

        /// <summary>
        /// Initialises a new instance of the ErrorEncounteredEventArgs class
        /// specifying a value for the error.
        /// </summary>
        /// <param name="error">
        /// An exception describing the error which was encountered.
        /// </param>
        public ErrorEncounteredEventArgs(Exception error)
        {
            this.error = error;
        }

        #endregion
    }
}
